home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / mail / YAMscripts.lha / ShowSubjects.rexx < prev    next >
OS/2 REXX Batch file  |  1997-06-24  |  1KB  |  37 lines

  1. /* ShowSubjects.rexx 1.1 - 01-Jun-97 */
  2. options results
  3. call addlib('rexxsupport.library',0,-30,0)
  4. rmsg='Messages in the folder*nnow have filenotes.'
  5. rbut='_Ok'
  6.  
  7. address 'YAM'
  8. 'Hide'
  9. 'GetMailInfo Act'    /* Which message is currently selected */
  10. act=result        /* Try to remember it */
  11. 'MailUpdate'        /* Let's make sure the index is up to date */
  12. 'GetFolderInfo Max'    /* How many messages are there? */
  13. n=result
  14.  
  15. do m=0 to n-1        /* Do for all messages in folder: */
  16.     'SetMail' m        /* Select a message */
  17.     'GetMailInfo File'    /* Get the filename */
  18.     file.m=result        /* Save the filename */
  19.     info=statef(result)    /* Get all kinds of info about the file */
  20.     parse var info type bytes blocks flags days min ticks comment
  21.     'GetMailInfo Subject'    /* Guess what it does now? */
  22.     subj=translate(result,"'",'"*')
  23.     if subj='' then subj='(No subject)'
  24.     comm.m=strip(left(left(strip(comment),2)||subj,79)) /* When you start stripping, do it properly :-) */
  25. end /* do m */
  26.  
  27. /* Now we know what needs to be done, let's do it! */
  28. do m=0 to n-1
  29.     address command 'filenote' file.m '"'comm.m'"'
  30.     if rc>0 then say 'filenote' file.m '"'comm.m'"'
  31. end
  32.  
  33. 'SetMail' act        /* Return to the message which was previously selected */
  34. 'Show'
  35. 'request "'rmsg'" "'rbut'"'
  36. exit
  37.